import 'package:flutter/material.dart';
import 'package:xiongan_app_yy/pages/unprocessed_task/children_tab_one.dart';
import 'package:xiongan_app_yy/pages/unprocessed_task/children_tab_three.dart';
import 'package:xiongan_app_yy/pages/unprocessed_task/children_tab_two.dart';
import 'package:xiongan_app_yy/widgets/comm/left_icon_widget.dart';

//任务待办
class TabPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return TabPageState();
  }


}

class TabPageState extends State<TabPage> with SingleTickerProviderStateMixin{


  TabController _tabController;


  final List<Tab> titleList = <Tab>[
    new Tab(text: '仓储管理',),
    new Tab(text: '检测管理',),
    new Tab(text: '配送管理',),
  ];


  @override
  void initState() {
    _tabController = new TabController(vsync: this, length: titleList.length);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        leading: LeftIconWidget(icon: Icons.chevron_left, isize: 36),
        backgroundColor: Color(0XFF00A5F1),
        title: Text(
          "任务待办",
          style: TextStyle(fontSize: 18),
        ),
        elevation: 0,
        centerTitle: true,
        bottom:PreferredSize(
          preferredSize: Size.fromHeight(48),
          child: Material(
              color: Colors.white,
              child: Stack(
                alignment: Alignment.center,
                children: <Widget>[
                  new TabBar(
                    controller: _tabController,
                    tabs: titleList,
                    indicatorColor: Color(0XFF00A5F1),
                    labelColor:  Color(0XFF00A5F1),
                    unselectedLabelColor: Color(0XFF646464),
                    indicatorPadding: EdgeInsets.only(bottom: 0),
                    indicatorSize: TabBarIndicatorSize.label,
                  ),
                ],
              )
          ),

        ),
      ),
      body: new TabBarView(
        controller: _tabController,
        children: [
          ChildrenTabOne(),
          ChildrenTabTwo(),
          ChildrenTabThree(),
        ],
      ),
    );
  }
}